<html lang="en">
<head>
	<meta name="auto" content='spider'>
	<meta charset="UTF-8">
	<title>旅行社管理系统</title>
	<link rel="stylesheet" type="text/css" href="../css/base.css">
	<link rel="stylesheet" type="text/css" href="../css/information.css">
	<link rel="stylesheet" type="text/css" href="../css/guide.css">
	<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

</head>
<body onload="fun()">

<style>
        fieldset{
            background-color: #f1f1f1;
            border: none;
            border-radius: 2px;
            margin-bottom: 12px;
            overflow: hidden;
            padding: 0 .625em;
        }

        label{
            cursor: pointer;
            display: inline-block;
            padding: 3px 6px;
            text-align: right;
            width: 150px;
            vertical-align: top;
        }

        input{
            font-size: inherit;
        }
    </style>

	<header id='header'>
		<div class='center'>
			<nav style='overflow:hidden;'>
				<!--为了大纲清晰，所以要加个标题-->
				<h2 class="none">网站导航</h2>
			<ul class="link">
					<li ><a href="index.html">首页</a></li>
					<li ><a href="tourist.html">旅客查询</a></li>
					<li class="active"><a href="guide.html">导游查询</a></li>
					<li><a href="route_main.html">路线查询</a></li>
					<li><a href="team.html">团队查询</a></li>
				<li><a href="city_main.html">城市管理</a></li>
				</ul>
			</nav>
		</div>
	</header>
	
	<div id="headline">
		<div class="center">
			<hgroup>
				<h2>旅行社管理系统</h2>
			</hgroup>
		</div>
	</div>
	<div id="containter">
		<aside class='sidebar'>




<div id="organ" οnclick="hideOrganDiv();">
       </div>
		</aside>
		<div class="list  airTicket">

		<h2>导游信息修改</h2>
		<hr>
			<form class="fo" action="#" method>
		<ul class="fo_city">

		<p>
            <label>导游号:</label>
            <input type="text" id="add_id">
        </p>
        <p>
            <label >姓名:</label>
            <input type="text" id="add_name">
        </p>
        <p>
            <label>性别:</label>
			<input type="text" id="add_sex">
        </p>
        <p>
            <label>团队数:</label>
			<input type="text" id="add_teamamount">
        </p>
		<p>
		    <label>年龄:</label>
			<input type="text" id="add_age">
		</p>
		<p>
		    <label>职称:</label>
		    <input type="text" id="add_level">
		</p>
		<p>
		    <label>身份证号:</label>
		    <input type="text" id="add_idcard">
		</p>
		<p>
		    <label>电话:</label>
		    <input type="text" id="add_phonenum">
		</p>
		<p>
		    <label>备注</label>
		    <input type="text" id="add_remark">
		</p>
		</ul>

		<div class="submit">
			<button id="submit_add" style="top:130px;right:190px;">修改</button>
		</div>
			</form>
		</div>
	</div>

			

		<script>
			function fun(){
				url=document.location.toString();//获取url地址
				var urlParmStr = url.slice(url.indexOf('?')+1);//获取问号后所有的字符串
				var arr = urlParmStr.split('&');//通过&符号将字符串分割转成数组
				var add_id=document.getElementById("add_id");
				add_id.value=arr[0].split("=")[1];

				var add_name=document.getElementById("add_name");
				add_name.value=unescape(arr[1].split("=")[1]);

				var add_sex=document.getElementById("add_sex");
				add_sex.value=arr[2].split("=")[1];

				var add_teamamount=document.getElementById("add_teamamount");
				add_teamamount.value=arr[3].split("=")[1];

				var add_age=document.getElementById("add_age");
				add_age.value=arr[4].split("=")[1];

				var add_level=document.getElementById("add_level");
				add_level.value=arr[5].split("=")[1];

				var add_idcard=document.getElementById("add_idcard");
				add_idcard.value=arr[6].split("=")[1];

				var add_phonenum=document.getElementById("add_phonenum");
				add_phonenum.value=arr[7].split("=")[1];

				var add_remark=document.getElementById("add_remark");
				add_remark.value=unescape(arr[8].split("=")[1]);
				
			}

			var btn = document.getElementById("submit_add");
			var id=document.getElementById("add_id");
			var guide_name = document.getElementById("add_name");
			var sex=document.getElementById("add_sex");
			var teamamount = document.getElementById("add_teamamount");
			var age = document.getElementById("add_age");
			var level=document.getElementById("add_level");
			var idcard= document.getElementById("add_idcard");
			var phone=document.getElementById("add_phonenum");
			var remark=document.getElementById("add_remark");
			var url1 ="http://39.108.233.68:8080/updOneLeader?";

			btn.onclick = function(){

			var id = document.getElementById("add_id");
			var guide_name = document.getElementById("add_name");
			var sex=document.getElementById("add_sex");
			var teamamount = document.getElementById("add_teamamount");
			var age = document.getElementById("add_age");
			var level=document.getElementById("add_level");
			var idcard= document.getElementById("add_idcard");
			var phone=document.getElementById("add_phonenum");
			var remark=document.getElementById("add_remark");
                $.ajax({
                    type: 'post',
                    url: 'http://39.108.233.68:8080/updOneLeader',
                    data: {
                    	id:id.value,
                    	name: guide_name.value,
                    	sex:sex.value,
                    	teamamount:teamamount.value,
                    	age:age.value,
                        level:level.value,
                        idcard:idcard.value,
                        phonenum:phone.value,
                        remark:remark.value
                    },
                    success:function (data) {
                    }

                        });
                alert("成功修改");
                    window.close();
            }
		</script>
<div style="height: 200px"></div>
<footer id='foot'>
	<div class="top">

		<h1>欢迎使用SUN旅行社</h1>

	</div>
	<div class="bottom">
		SUN旅行社 |  | 旅行经营许可证
	</div>
</footer>
</body>
</html>